package com.xin.di.uav.common.enums;

import lombok.Getter;
/**
 * @author 01430312
 */
@Getter
public enum CommodityStatusEnum {

    /**
     * 商品状态方式枚举
     */
    GROUNDING("上架", 1),
    OFF("下架", 2),

    SOLD_OUT("已售罄",0);

    private final String desc;

    private final Integer value;

    CommodityStatusEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }
    public static String getDesc(Integer value) {
        for (CommodityStatusEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }

}
